<template>
    <div>
       <h1>门店信息录入</h1>
       <table class="table">
        <thead>
            <tr>
                <td>门店名称</td>
                <td>
                    <input type="text" v-model="data.name">
                </td>
            </tr>
            <tr>
                <td>门店地址</td>
                <td>
                    <input type="text" v-model="data.addr">
                </td>
            </tr>
            <tr>
                <td>门店电话</td>
                <td>
                    <input type="text" v-model="data.phone">
                </td>
            </tr>
            <tr>
                <td>门店人数</td>
                <td>
                    <input type="text" v-model="data.num">
                </td>
            </tr>
            <tr>
                <td>门店大小</td>
                <td>
                    <input type="text" v-model="data.sise">
                </td>
            </tr>
            <tr>
                
                <td colspan="2">
                    <input type="button" value="添加" @click="Add">
                </td>
            </tr>
        </thead>
       </table>
    </div>
</template>

<script setup lang="ts">
import {ref} from "vue"
import axios from "axios";
const data=ref({
    "id": 0,
  "name": "",
  "addr": "",
  "phone": "",
  "num": 0,
  "sise": 0
})
const Add=()=>{
    axios.post("https://localhost:7034/api/Member/AddMember",data.value).then(res=>{
        if(res.data>0){
          alert('添加成功');
          location.href='/ShowView';
        }
        else{
            alert('添加失败');
        }
    })
}
</script>

<style scoped>

</style>